import {request} from "@/utils/request.js"


const status = {
    1: "未提交",
    2: "已提交",
    3: "已派单",
    4: "已完成",
    5: "已取消",
}

const deviceRepairApiService = {
    list(param) {
        return request("/tbx/kangyangu/mdDeviceRepair/list", "get", param)
    },
    detail(params) {
        return request("/tbx/kangyangu/mdDeviceRepair/queryById", "get", params)
    },
    add(data) {
        return request("/tbx/kangyangu/mdDeviceRepair/add", "post", data)

    },
    chancel(data) {
        return request("/tbx/kangyangu/mdDeviceRepair/chancel", "post", data)

    },
    statusString(value) {
        return status[value]
    },
    statusMap() {
        let data = []
        for (const [key, value] of Object.entries(status)) {
            data.push({
                id: key,
                label: value
            })
        }
        return data
    },

};

export default deviceRepairApiService
